<?php

namespace App\Http\Controllers\Erp;

use App\Repositories\Stock\ProductStockRepository;
use Illuminate\Http\Request;

class ProductStockController extends ErpController
{
    protected $productStockRepository;

    public function __construct(ProductStockRepository $productStockRepository)
    {
        $this->productStockRepository = $productStockRepository;

    }

    //产品库存列表
    public function list(Request $request)
    {
        $input = $request->input();

        $list = $this->productStockRepository->getListWithProduct();
        $totalCostPrice = $this->productStockRepository->getTotalCostPrice();//获取总金额

        return array_merge(['total_cost_price'=>$totalCostPrice],$this->paginate($list));
    }



}